package com.easy;

/**
 * Created by Lxk on 2020/2/16.
 */
public class Solution231 {

    public boolean isPowerOfTwo(int n) {
        while (n != 0) {
            if (n % 2 == 1 && n != 1) {
                return false;
            }
            n = n / 2;
        }
        return true;
    }

    public static void main(String[] args) {
        Solution231 solution231 = new Solution231();
        System.out.println(solution231.isPowerOfTwo(1));
    }

}
